home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS Toolkit
/
BBS Toolkit.iso
/
maximus
/
mul100.zip
/
MUL.DOC
< prev
next >
Wrap
Text File
|
1993-02-09
|
18KB
|
368 lines
┌─┐ ┌─┐
└─┼──────────────────────────────────────────────────────────────────────┼─┘
│ │
│ MUL Version 1.00 │
│ │
│ Maximus-CBCS User Base Script Interpreter │
│ │
│ │
│ DISTRIBUTED AS LOW COST SHAREWARE │
│ │
│ │
│ (C) Copyright 1990-1993 by CodeLand, All Rights Reserved │
│ │
│ Created Febuary 9th, 1993. │
│ │
│ Written by Colin Wheat of Fidonet 3:690/613 │
│ │
┌─┼──────────────────────────────────────────────────────────────────────┼─┐
└─┘ └─┘
┌──────────────────────────────────────────────────────────────────────────┐
└─ LICENCE ────────────────────────────────────────────────────────────────┘
1. DISTRIBUTION. YOU MAY COPY AND DISTRIBUTE VERBATIM COPIES OF
THE MUL EXECUTABLE CODE AS YOU RECEIVE IT, IN ANY MEDIUM,
PROVIDED THAT YOU CONSPICUOUSLY AND APPROPRIATELY PUBLISH ON
EACH COPY A VALID COPYRIGHT NOTICE; KEEP INTACT THE NOTICES ON
ALL FILES THAT REFER TO THIS LICENSE AGREEMENT AND TO THE
ABSENCE OF ANY WARRANTY; PROVIDE UNMODIFIED COPIES OF THE
DOCUMENTATION AS PROVIDED WITH THE PROGRAM; AND GIVE ANY OTHER
RECIPIENTS OF MUL A COPY OF THIS LICENSE AGREEMENT ALONG WITH
THE PROGRAM. YOU MAY CHARGE A DISTRIBUTION FEE FOR THE PHYSICAL
ACT OF TRANSFERING A COPY, BUT NO MORE THAN IS NECESSARY TO
RECOVER YOUR ACTUAL COSTS INCURRED IN THE TRANSFER.
2. COPYING. YOU MAY NOT COPY, SUBLICENSE, DISTRIBUTE OR TRANSFER
MUL EXCEPT AS EXPRESSLY PROVIDED UNDER THIS LICENSE
AGREEMENT. ANY ATTEMPT OTHERWISE TO COPY, SUBLICENSE,
DISTRIBUTE OR TRANSFER MUL IS VOID AND YOUR RIGHTS TO USE THE
PROGRAM UNDER THIS LICENSE AGREEMENT SHALL BE TERMINATED.
3. MODIFICATION. WITH THE EXCEPTION OF ARCHIVING METHOD, MUL
SHOULD NOT BE DISTRIBUTED IN ANY MODIFIED FORM. THE COMPLETE
ARCHIVE SHOULD BE DISTRIBUTED CONTAINING THE ORIGINAL FILES. IT
MAY BE RE-PACKAGED USING A DIFFERENT ARCHIVAL METHOD AS LONG AS
THE CONTENTS OF THE ARCHIVE ARE THE SAME AS THAT OF THE
DISTRIBUTION KIT. ADDITIONAL FILES MAY NOT BE ADDED TO ARCHIVE.
4. PROGRAM STATUS. THIS PROGRAM IS DISTRIBUTED AS LOW COST SHARE
WARE, NOT PUBLIC DOMAIN NOR FREEWARE. PAYMENT OF THE REQUIRED
FEE IS MANDATORY FOR CONTINUED USE OF THE PROGRAM. ALL USERS OF
THE PROGRAM SHOULD REGISTER THE PRODUCT USING THE REGISTRATION
FORM SUPPLIED WITH THE PACKAGE.
5. DISCLAIMER. USE THIS PROGRAM AT YOUR OWN RISK. NO WARRANTY IS
STATED OR IMPLIED. THE AUTHOR SHALL NOT BE HELD RESPONSIBLE
FOR ANY DAMAGES RESULTING FROM IT'S USE DIRECTLY OR INDIRECTLY.
┌──────────────────────────────────────────────────────────────────────────┐
└─ INTRODUCTION ───────────────────────────────────────────────────────────┘
MUL (Maximus User Language) is a program that runs scripts
written in a subset of the C language, with special features
suited to the Maximus-CBCS User Base.
Special functions and variables are included which will modify
the User Base as well as generate reports for display on your
Bulletin Board and run regular maintenance. MUL is very flexible
and almost the only limitation upon what can be done is the
script writing ability of the user.
Scripts can be as simple as the "Hello, world" echo to the
screen, or as interesting as the one run to give the result
shown below (CALLSTAT.SCR) ..
┌────────────────────────────────────────────────────────────────────────────┐
│ Caller Statistics Report MUL v1.00 - the Maximus User Language │
│┌──────────────────────────────────────────────────────────────────────────┐│
││ ┌──────────────────┐ ││
││ System Calls Graph │ System Calls │ ││
││ ┌─ ┌───────────────────────────────────────────┐ ├──────────────────┤ ││
││ │100 ┤ █ █ │ │ 1 172 │ ││
││ │ ┤ █ █ │ │ 2 - 9 185 │ ││
││ │ 80 ┤ █ █ │ │ 10 - 19 31 │ ││
││ U ┤ █ █ │ │ 20 - 29 21 │ ││
││ s 60 ┤ █ █ │ │ 30 - 39 16 │ ││
││ e ┤ █ █ █ █ │ │ 40 - 49 8 │ ││
││ r 40 ┤ █ █ █ █ │ │ 50 - 74 16 │ ││
││ s ┤ █ █ █ █ █ │ │ 75 - 99 16 │ ││
││ │ 20 ┤ █ █ █ █ ▄ ▄ ▄ █ █ █ │ │ 100 - 249 51 │ ││
││ │ ┤ █ █ █ █ █ ▄ █ █ █ █ █ │ │ 250 - 399 23 │ ││
││ │ 1 ┤ █ █ █ █ █ █ █ █ █ █ █ │ │ 400+ 55 │ ││
││ │ └─┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─┘ │ Calls Users │ ││
││ │ 1 2-9 10 20 30 40 50 75 100 250 400+ └──────────────────┘ ││
││ └────────────────── Calls Logged ────────────────┘ ││
│└ Out of a total of 595 accounts, 251 were accessed in the last 30 days ┘│
└────────────────────────────────────────────────────────────────────────────┘
The possibilites for MUL are endless and all that is necessary
is a basic understanding of the C language. (Actually, not even
that is necessary as many SysOps are likely to write a program
for their own use and then release it to the Network.)
This package is SHAREWARE software. The SHAREWARE classification
allows full public distribution, try before you buy, and free
evaluation of the package. Please register using the provided
registration form (REGISTER.DOC) after a reasonable evaluation
period. Our thanks for your support. We hope you find MUL as
useful on your system as we have on ours since it's development
during 1992.
┌──────────────────────────────────────────────────────────────────────────┐
└─ ARCHIVE CONTENTS ───────────────────────────────────────────────────────┘
MUL.EXE - The MUL interpreter executable (DOS version)
MUL.INI - Sample configuration file
MUL.DOC - Main package documentation
MULQKREF.DOC - MUL quick reference (three pages)
MULFNREF.DOC - Intrinsic function reference documentation
MULVAREF.DOC - Intrinsic variable reference documentation
REGISTER.DOC - Package registration form
┌────────────────────────────────────┐
└─ SAMPLE SCRIPTS ───────────────────┘
BSORT.SCR - Maximus user base sorting
BSORT.BAT - Batch file to run Bsort
CALLERS.SCR - Today's callers online avatar report
generator
CALLSTAT.SCR - Maximus user base call statistics
avatar report
EXPRPT.SCR - Sysop text file report of account
expiry information
EXPWARN.SCR - Post expiry warning messages to users
using Msgpost
MAKUSER.SCR - Batch file account addition via text
file description
MAKUSER.DAT - Sample data file for MakUser
MAXPLAY.SCR - Plays Maximus TUNES.BBS tunes
MAZE.SCR - Demonstration - generate a maze on
screen
MORSE.SCR - Plays command line in morse code
PACK.SCR - Maximus user base delete scan and pack,
full screen
PACK.BAT - Batch file to run Pack
PHONEFIX.SCR - Adjust all user base phone fields to
preset mask
REGUSER.LZH - New user registration system by John Daniels
RDUSR.SCR - Simple list users to system console
REMDEM.SCR - Remove demote settings for all user records
SETCRDT.SCR - Set credit value for all user records
TOPUSER.SCR - Top users online avatar report generator
VIEW.SCR - UEDit style read only edit screen, full
screen
VIEW.BAT - Batch file to run View
┌──────────────────────────────────────────────────────────────────────────┐
└─ RUNNING MUL ────────────────────────────────────────────────────────────┘
To run MUL enter at the operating system level:
MUL [/p<script file path & name>] [script arguments]
If filename is not specified, MUL will attempt to run MUL.SCR in
the current directory. The default extension is .SCR.
Example: MUL -pVIEW
┌──────────────────────────────────────────────────────────────────────────┐
└─ COMMAND LINE SWITCHES ──────────────────────────────────────────────────┘
Syntax: MUL [-switch -switch ...] [script arguments ...]
-p Program script file path & name
-v Verbose mode screen messages
-b BIOS screen writing
-r CGA snow reduction
-m Force monochrome text attributes
-i Configuration file path & name
-? Program help screen
┌──────────────────────────────────────────────────────────────────────────┐
└─ DO I HAVE TO KNOW 'C' TO USE MUL? ──────────────────────────────────────┘
If you have no knowledge of C, this is an ideal way to start on
your way to a better understanding. No "include" files or
"define"s are necessary and functions do not need to be declared
as a type. Of course, the more you know about C the bigger and
better your scripts will be, but this will come with time and an
effort to learn. A list of already declared functions and
variables are included in the documentation.
┌──────────────────────────────────────────────────────────────────────────┐
└─ TO WRITE YOUR FIRST SCRIPT ─────────────────────────────────────────────┘
A basic script consists of the main part of the program, curly
brackets to signify the start and finish of the code and the
lines of code which tell MUL what to do. Here is a sample of a
simple script. Type it in yourself and see how it works.
main()
{
printf ("My first script.\n");
}
Type the above example into a file called (for this example)
FIRST.SCR and then execute the script by entering the following
line at the system prompt. Note that MUL will assume a script
name extension of ".SCR" if none is given on the command line.
mul -pFIRST
The following line should be printed to the screen.
My first script.
Congratulations, you've just executed your first MUL script! (-8
More complex and useful scripts are easily developed, the scope
and purposes for which are only limited by your imagination.
We're not able to enter into a full programing tutorial here,
but all the intrinsic (built in) MUL functions available are
fully detailed in the MULFNREF.DOC file, which also includes
full working script examples for every function. All the
intrinsic variables are detailed in the MULVAREF.DOC file.
Rather than attempt a full programming tutorial for the C
language, a subset of which MUL scripts are based upon, we'll
quickly step through one of the example scripts, called
EXPWARN.SCR. Firstly however, you may wish to execute a few of
the example scripts provided. Try the following commands from
the system prompt.
mul -pMORSE sos
mul -pMAZE
mul -pVIEW
┌──────────────────────────────────────────────────────────────────────────┐
└─ THE PARTS THAT MAKE UP A SCRIPT ────────────────────────────────────────┘
Comments can be placed in a script by placing two forward
slashes at the beginning of the line.
i.e.
// MUL is (C) Copyright 1990-93 by CodeLand Australia
This example script will scan your user file for records with a
date expiry setting. Each record found is checked for a match
of days to expiry with the 'warndays' variable setting. Where
matches are found, the 'warnexp' command line entry is executed.
This enables functions such as posting a message to warn users
of a pending expiry.
This script is based on the executable of the same name, also by
Colin Wheat, originally written for Simon Blears of 3:690/601.
Declaration of files is as follows. Paths may be used.
char *ufile = "USER.BBS"; // Path & name of Maximus user file
//char *ufile = "C:\\BBS\\USER.BBS";
Declaration of variables:
int warndays=14; // Issue warning days before expiry
char *warnexp = "MsgPost -TC:\\Util\\WarnExp.Txt \"-F%s\"";
The *warnexp variable posts a message to accounts with expiry
pending in 'warndays' days. MsgPost will post a message to the
user warning of the pending expiry.
char *banner = "EXPWARN v1.00"; // Script banner
char *desc = "Warn of Pending Expiry"; // Description
main () // Main program
{
printf ("\n%s - %s\n\n",banner,desc); // Announce
if (!BaseOpenR (ufile))
{
printf ("ERROR opening user file %s\n",ufile);
saybibi ();
exit ();
}
This first part will print the program name and version to the
screen (see contents of variable *banner, above) and what the
program will do. If the file that the program is trying to open
isn't there or can't be opened for use by the program an error
message will be written to the screen. In this case, the
function saybibi is called (the function is at the end of this
program) and the program will exit.
scanufile (); //Process the user file
BaseClose (); // Close the user base
saybibi (); // Was it good for you too?
}
The last part of the main program calls three functions one of
which will exit the program, one (BaseClose) of which is an
already declared function (see other documentation with this
package, and one of which is explained below.
scanufile () // Process the user file
{
int rec=1;
char buf[128];
More variables are declared.
while (BaseRead (rec++)) // Read all records
{
if (And (USRxpflag,XP_DATE)) // If expire by date
{
if (BaseDaysXpry () == warndays)
{
printf("Warning: %04u %-25s\n",rec,USRname);
sprintf (buf,warnexp,USRname);
system (buf);
} //end of if BaseDays
} //end of if USR
} //end of while loop
} //end of function scanufile
While there are records to be read in the userfile this loop
will read the record, check the expiry date, and if the expiry
date is 14 days or less a way from todays date will print the
warning message and username.
// Byebye
saybibi ()
{
puts ("\nExpWarn done!\n");
}
// End of script
┌─ Happy script writing! ──────────────────────────────────────────────────┐
└──────────────────────────────────────────────────────────────────────────┘
Documentation by Crossroads Computer Documentation and CodeLand Australia
CROSSROADS COMPUTER DOCUMENTATION
Fidonet 3:690/310 Worldnet 61:7200/310
P.O. Box 3 Northlands W.A. 6021 AUSTRALIA
CODELAND AUSTRALIA
P.O.Box 351, Kalamunda W.A. 6076, AUSTRALIA